using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public sealed class frmVehicles : Form
{
	private string string_0 = string.Empty;
	private IContainer icontainer_0;
	private DataGridView dataGridView1;
	private ComboBox cbxWard;
	private ComboBox cbxDistrict;
	private ComboBox cbxProvince;
	private Label label9;
	private Label label8;
	private Label label7;
	private Label label1;
	private Button btnEdit;
	private Button btnAdd;
	private Button btnDelete;
	private Button btnClose;
	private DataGridViewTextBoxColumn STT;
	private DataGridViewTextBoxColumn IDColumn;
	private DataGridViewTextBoxColumn PlateNumberColumn;
	private DataGridViewTextBoxColumn OwnerNameColumn;
	private DataGridViewTextBoxColumn OwnerCardIDColumn;
	private DataGridViewTextBoxColumn OwnerAddressColumn;
	private DataGridViewTextBoxColumn WardIDColumn;
	private DataGridViewCheckBoxColumn IsBlacklistColumn;
	private DataGridViewTextBoxColumn DescriptionColumn;
	public frmVehicles()
	{
        this.InitializeComponent();
        Color.FromName(MainForm.SystemConfiguration_0.string_15);
        foreach (BO4 class2 in MainForm.SystemConfiguration_0.ExtendCollection0_0)
        {
            this.cbxProvince.Items.Add(class2.method_2());
        }
        if (this.cbxProvince.Items.Count > 0)
        {
            this.cbxProvince.SelectedIndex = 0;
            for (int i = 0; i < MainForm.SystemConfiguration_0.ExtendCollection0_0.Count; i++)
            {
                if (MainForm.SystemConfiguration_0.ExtendCollection0_0.Get(i).method_4() == MainForm.SystemConfiguration_0.string_6)
                {
                    this.cbxProvince.SelectedIndex = i;
                    break;
                }
            }
            this.method_0();
        }
	}
	private void frmVehicles_Load(object sender, System.EventArgs e)
	{
	}
	private void method_0()
	{
		this.cbxDistrict.Enabled = false;
		this.cbxWard.Enabled = false;
		this.cbxDistrict.Items.Clear();
		this.cbxDistrict.Items.Add("-----Tất cả-----");
		if (this.cbxProvince.SelectedIndex >= 0)
		{
			BO4 gClass = MainForm.SystemConfiguration_0.ExtendCollection0_0.Search(this.cbxProvince.Text);
			if (gClass != null)
			{
				this.string_0 = " where WardID in (select ID from tblWard where ProvinceID = " + gClass.method_0() + ")";
				foreach (BO3 gClass2 in MainForm.SystemConfiguration_0.gclass8_0)
				{
					if (gClass2.method_4() == gClass.method_0())
					{
						this.cbxDistrict.Items.Add(gClass2.method_2());
					}
				}
				if (this.cbxDistrict.Items.Count > 0)
				{
					this.cbxDistrict.Enabled = true;
				}
			}
		}
		this.cbxDistrict.SelectedIndex = 0;
	}
	private void method_1()
	{
		this.cbxWard.Enabled = false;
		this.cbxWard.Items.Clear();
		this.cbxWard.Items.Add("-----Tất cả-----");
		if (this.cbxProvince.SelectedIndex >= 0)
		{
			BO4 gClass = MainForm.SystemConfiguration_0.ExtendCollection0_0.Search(this.cbxProvince.Text);
			if (gClass != null)
			{
				this.string_0 = " where WardID in (select ID from tblWard where ProvinceID = " + gClass.method_0() + ")";
				if (this.cbxDistrict.SelectedIndex > 0)
				{
					BO3 gClass2 = MainForm.SystemConfiguration_0.gclass8_0.Search(gClass.method_0(), this.cbxDistrict.Text);
					if (gClass2 != null)
					{
						this.string_0 = " where WardID in (select ID from tblWard where DistrictID = " + gClass2.method_0() + ")";
						foreach (BO2 gClass3 in MainForm.SystemConfiguration_0.gclass6_0)
						{
							if (gClass3.method_4() == gClass2.method_0())
							{
								this.cbxWard.Items.Add(gClass3.method_2());
							}
						}
						if (this.cbxWard.Items.Count > 0)
						{
							this.cbxWard.Enabled = true;
						}
					}
				}
			}
		}
		this.cbxWard.SelectedIndex = 0;
	}
	private void method_2(string string_1)
	{
		MainForm.SystemConfiguration_0.method_27(this.dataGridView1, string_1);
		this.btnEdit.Enabled = (this.btnDelete.Enabled = (this.dataGridView1.RowCount > 0));
	}
	private void cbxProvince_SelectedIndexChanged(object sender, System.EventArgs e)
	{
		this.method_0();
		this.method_2(this.string_0);
	}
	private void cbxDistrict_SelectedIndexChanged(object sender, System.EventArgs e)
	{
		this.method_1();
		this.method_2(this.string_0);
	}
	private void cbxWard_SelectedIndexChanged(object sender, System.EventArgs e)
	{
		if (this.cbxProvince.SelectedIndex >= 0)
		{
			BO4 gClass = MainForm.SystemConfiguration_0.ExtendCollection0_0.Search(this.cbxProvince.Text);
			if (gClass != null)
			{
				this.string_0 = " where WardID in (select ID from tblWard where ProvinceID = " + gClass.method_0() + ")";
				if (this.cbxDistrict.SelectedIndex > 0)
				{
					BO3 gClass2 = MainForm.SystemConfiguration_0.gclass8_0.Search(gClass.method_0(), this.cbxDistrict.Text);
					if (gClass2 != null)
					{
						this.string_0 = " where WardID in (select ID from tblWard where DistrictID = " + gClass2.method_0() + ")";
						if (this.cbxWard.SelectedIndex > 0)
						{
							BO2 gClass3 = MainForm.SystemConfiguration_0.gclass6_0.Search(gClass2.method_0(), this.cbxWard.Text);
							if (gClass3 != null)
							{
								this.string_0 = " where WardID = " + gClass3.method_0();
							}
						}
					}
				}
			}
		}
		this.method_2(this.string_0);
	}
	private void btnClose_Click(object sender, System.EventArgs e)
	{
		base.Close();
	}
	private void btnAdd_Click(object sender, System.EventArgs e)
	{
	}
	private void btnEdit_Click(object sender, System.EventArgs e)
	{
	}
	private void btnDelete_Click(object sender, System.EventArgs e)
	{
		if (this.dataGridView1.RowCount > 0)
		{
			DataGridViewRow currentRow = this.dataGridView1.CurrentRow;
			int int_ = System.Convert.ToInt32(currentRow.Cells["IDColumn"].Value.ToString());
            BO1 gClass = MainForm.SystemConfiguration_0.gclass4_0.Find(int_);
			if (gClass != null && MainForm.SystemConfiguration_0.method_26(gClass))
			{
				this.method_2(this.string_0);
			}
		}
	}
	protected override void Dispose(bool disposing)
	{
		if (disposing && this.icontainer_0 != null)
		{
			this.icontainer_0.Dispose();
		}
		base.Dispose(disposing);
	}
	private void InitializeComponent()
	{
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmVehicles));
        this.dataGridView1 = new System.Windows.Forms.DataGridView();
        this.STT = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.IDColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.PlateNumberColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.OwnerNameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.OwnerCardIDColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.OwnerAddressColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.WardIDColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.IsBlacklistColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
        this.DescriptionColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
        this.cbxWard = new System.Windows.Forms.ComboBox();
        this.cbxDistrict = new System.Windows.Forms.ComboBox();
        this.cbxProvince = new System.Windows.Forms.ComboBox();
        this.label9 = new System.Windows.Forms.Label();
        this.label8 = new System.Windows.Forms.Label();
        this.label7 = new System.Windows.Forms.Label();
        this.label1 = new System.Windows.Forms.Label();
        this.btnEdit = new System.Windows.Forms.Button();
        this.btnAdd = new System.Windows.Forms.Button();
        this.btnDelete = new System.Windows.Forms.Button();
        this.btnClose = new System.Windows.Forms.Button();
        ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
        this.SuspendLayout();
        // 
        // dataGridView1
        // 
        this.dataGridView1.AllowUserToAddRows = false;
        this.dataGridView1.AllowUserToDeleteRows = false;
        this.dataGridView1.AllowUserToResizeRows = false;
        resources.ApplyResources(this.dataGridView1, "dataGridView1");
        this.dataGridView1.BackgroundColor = System.Drawing.Color.White;
        this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
        this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.STT,
            this.IDColumn,
            this.PlateNumberColumn,
            this.OwnerNameColumn,
            this.OwnerCardIDColumn,
            this.OwnerAddressColumn,
            this.WardIDColumn,
            this.IsBlacklistColumn,
            this.DescriptionColumn});
        this.dataGridView1.Name = "dataGridView1";
        this.dataGridView1.ReadOnly = true;
        this.dataGridView1.RowHeadersVisible = false;
        this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
        // 
        // STT
        // 
        resources.ApplyResources(this.STT, "STT");
        this.STT.Name = "STT";
        this.STT.ReadOnly = true;
        // 
        // IDColumn
        // 
        resources.ApplyResources(this.IDColumn, "IDColumn");
        this.IDColumn.Name = "IDColumn";
        this.IDColumn.ReadOnly = true;
        // 
        // PlateNumberColumn
        // 
        resources.ApplyResources(this.PlateNumberColumn, "PlateNumberColumn");
        this.PlateNumberColumn.Name = "PlateNumberColumn";
        this.PlateNumberColumn.ReadOnly = true;
        // 
        // OwnerNameColumn
        // 
        resources.ApplyResources(this.OwnerNameColumn, "OwnerNameColumn");
        this.OwnerNameColumn.Name = "OwnerNameColumn";
        this.OwnerNameColumn.ReadOnly = true;
        // 
        // OwnerCardIDColumn
        // 
        resources.ApplyResources(this.OwnerCardIDColumn, "OwnerCardIDColumn");
        this.OwnerCardIDColumn.Name = "OwnerCardIDColumn";
        this.OwnerCardIDColumn.ReadOnly = true;
        // 
        // OwnerAddressColumn
        // 
        resources.ApplyResources(this.OwnerAddressColumn, "OwnerAddressColumn");
        this.OwnerAddressColumn.Name = "OwnerAddressColumn";
        this.OwnerAddressColumn.ReadOnly = true;
        // 
        // WardIDColumn
        // 
        resources.ApplyResources(this.WardIDColumn, "WardIDColumn");
        this.WardIDColumn.Name = "WardIDColumn";
        this.WardIDColumn.ReadOnly = true;
        // 
        // IsBlacklistColumn
        // 
        resources.ApplyResources(this.IsBlacklistColumn, "IsBlacklistColumn");
        this.IsBlacklistColumn.Name = "IsBlacklistColumn";
        this.IsBlacklistColumn.ReadOnly = true;
        // 
        // DescriptionColumn
        // 
        resources.ApplyResources(this.DescriptionColumn, "DescriptionColumn");
        this.DescriptionColumn.Name = "DescriptionColumn";
        this.DescriptionColumn.ReadOnly = true;
        // 
        // cbxWard
        // 
        this.cbxWard.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
        resources.ApplyResources(this.cbxWard, "cbxWard");
        this.cbxWard.FormattingEnabled = true;
        this.cbxWard.Name = "cbxWard";
        this.cbxWard.SelectedIndexChanged += new System.EventHandler(this.cbxWard_SelectedIndexChanged);
        // 
        // cbxDistrict
        // 
        this.cbxDistrict.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
        resources.ApplyResources(this.cbxDistrict, "cbxDistrict");
        this.cbxDistrict.FormattingEnabled = true;
        this.cbxDistrict.Name = "cbxDistrict";
        this.cbxDistrict.SelectedIndexChanged += new System.EventHandler(this.cbxDistrict_SelectedIndexChanged);
        // 
        // cbxProvince
        // 
        this.cbxProvince.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
        this.cbxProvince.FormattingEnabled = true;
        resources.ApplyResources(this.cbxProvince, "cbxProvince");
        this.cbxProvince.Name = "cbxProvince";
        this.cbxProvince.SelectedIndexChanged += new System.EventHandler(this.cbxProvince_SelectedIndexChanged);
        // 
        // label9
        // 
        resources.ApplyResources(this.label9, "label9");
        this.label9.Name = "label9";
        // 
        // label8
        // 
        resources.ApplyResources(this.label8, "label8");
        this.label8.Name = "label8";
        // 
        // label7
        // 
        resources.ApplyResources(this.label7, "label7");
        this.label7.Name = "label7";
        // 
        // label1
        // 
        resources.ApplyResources(this.label1, "label1");
        this.label1.Name = "label1";
        // 
        // btnEdit
        // 
        resources.ApplyResources(this.btnEdit, "btnEdit");
        this.btnEdit.Name = "btnEdit";
        this.btnEdit.UseVisualStyleBackColor = true;
        this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
        // 
        // btnAdd
        // 
        resources.ApplyResources(this.btnAdd, "btnAdd");
        this.btnAdd.Name = "btnAdd";
        this.btnAdd.UseVisualStyleBackColor = true;
        this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
        // 
        // btnDelete
        // 
        resources.ApplyResources(this.btnDelete, "btnDelete");
        this.btnDelete.Name = "btnDelete";
        this.btnDelete.UseVisualStyleBackColor = true;
        this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
        // 
        // btnClose
        // 
        resources.ApplyResources(this.btnClose, "btnClose");
        this.btnClose.Name = "btnClose";
        this.btnClose.UseVisualStyleBackColor = true;
        this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
        // 
        // frmVehicles
        // 
        resources.ApplyResources(this, "$this");
        this.Controls.Add(this.btnClose);
        this.Controls.Add(this.btnDelete);
        this.Controls.Add(this.btnAdd);
        this.Controls.Add(this.btnEdit);
        this.Controls.Add(this.label1);
        this.Controls.Add(this.cbxWard);
        this.Controls.Add(this.cbxDistrict);
        this.Controls.Add(this.cbxProvince);
        this.Controls.Add(this.label9);
        this.Controls.Add(this.label8);
        this.Controls.Add(this.label7);
        this.Controls.Add(this.dataGridView1);
        this.Name = "frmVehicles";
        this.Load += new System.EventHandler(this.frmVehicles_Load);
        ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
        this.ResumeLayout(false);
        this.PerformLayout();

	}
}
